using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace Slqj.Data
{
	public static class TableOrderStatus
	{
		public const string Table = "OrderStatus";
		public const string OrderStatusID = "OrderStatusID";
		public const string OrderStatusName = "OrderStatusName";
	}
	
	[Serializable]
	public class BaseOrderStatus
		: IDbSessionEntity, IJsonClass
	{
		int m_OrderStatusID;
		/// <summary>
        /// 订单状态表ID
        /// </summary>
        public int OrderStatusID
        {
            get { return m_OrderStatusID; }
            set { m_OrderStatusID = value; }
        }
		
		string m_OrderStatusName;
		/// <summary>
        /// 订单状态名称
        /// </summary>
        public string OrderStatusName
        {
            get { return m_OrderStatusName; }
            set { m_OrderStatusName = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_OrderStatusID = reader[TableOrderStatus.OrderStatusID];
            m_OrderStatusName = reader[TableOrderStatus.OrderStatusName];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableOrderStatus.OrderStatusID, PrimaryKeyType.Identity, OrderStatusID);
			writer[TableOrderStatus.OrderStatusName] = OrderStatusName;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_OrderStatusID = idd;
        }
		
		public string TableName
        {
            get { return TableOrderStatus.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_OrderStatusID = hashToRead["OrderStatusID"];
			 
             m_OrderStatusName = hashToRead["OrderStatusName"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["OrderStatusID"] = OrderStatusID;
			 
            hashToFill["OrderStatusName"] = OrderStatusName;
			 
        }

        #endregion
		
	}
}
